import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';

const { createConfirm } = useMessage();

enum Api {
  list = '/tm/tmapi/stockList',
  listAsync = '/tm/tmapi/stockList2',
  updateStock = '/tm/tmapi/updateStock',
  flushstock = '/tm/tmapi/flushStock',
}
/**
 * 列表接口
 * @param params
 */
export const list = (params) => defHttp.get({ url: Api.list, params, timeout: 20 * 1000 });

/**
 * 多线程列表接口
 * @param params
 */
export const listAsync = (params) => defHttp.get({ url: Api.listAsync, params, timeout: 20 * 1000 });

/**
 * 从数据库查询库存记录
 * @param params
 */
export const listAll = (params) => defHttp.get({ url: '/tm/tmapi/listAll', params, timeout: 20 * 1000 });

/**
 * 更新库存
 * @param params
 */
export const flushstock = () => defHttp.get({ url: Api.flushstock, timeout: 20 * 1000 });
